<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
  <a href="UserServlet?method=findAllUser">获取所有用户数据</a>
  <c:if test="${list != null }">
      <table border="1" style="width:300px;">
	      <thead>
	         <tr>
	            <th>用户id</th>
	            <th>姓名</th>
	            <th>密码</th>
	            <th>操作</th>
	         </tr>
	      </thead>
	      <tbody>
	          <c:forEach items="${list }" var="user">
	             <tr>
	                <td>${user.id }</td>
	                <td>${user.name }</td>
	                <td>${user.password }</td>
	                <td>
	                   <a href="UserServlet?method=updateUser&id=${user.id }">编辑</a>&nbsp;
	                   &nbsp;<a href="UserServlet?method=deleteUser&id=${user.id }">删除</a>
	                </td>
	             </tr>
	          </c:forEach>
	      </tbody>
      </table>
  </c:if>

</body>
</html>